﻿<%
'***********************
'*自适应网站语言
'***********************
if session("language")="cn" or session("language")="" then
	SiteLanguage = 0
else
	SiteLanguage = 1
end if
'response.write (SiteLanguage)
'***********************
'*获取网站配置
'***********************
function GetWebSiteConfig(strdata)
	dim strWebSiteConfig
	strWebSiteConfig=""
	sql=" Select * from config"
	Set rs = Server.CreateObject ("ADODB.Recordset")
	rs.open sql,conn,1,1
	if not rs.eof then
		select case strdata
		case "Title"
			if  SiteLanguage = 0 then
				strWebSiteConfig = GetWebSiteActuallyTitle(0) & rs("title")
			else
				strWebSiteConfig = GetWebSiteActuallyTitle(1) & rs("etitle")
			end if
		case "copyright"
			strWebSiteConfig = rs("copyright")
		case "ecopyright"
			strWebSiteConfig = rs("ecopyright")
		end select		
	end if 
	rs.close
	set rs=nothing
	GetWebSiteConfig = strWebSiteConfig
End Function
'***********************
'*获取网页标题
'***********************
function GetWebSiteActuallyTitle(tmplanguage)
	dim strWebSiteActuallyTitle
	strWebSiteActuallyTitle=""
	if SiteLanguage = 0 then
		select case request.ServerVariables("PATH_INFO")
		case "/index.asp",""
			strWebSiteActuallyTitle = "首页"
		case "/page.asp"	
			select case  request.ServerVariables("QUERY_STRING")
			case "type=about"
				'strWebSiteActuallyTitle = "公司简介"
			case "type=contact"
				'strWebSiteActuallyTitle = "联系我们"
			end select 
		case "/Company.asp"
			strWebSiteActuallyTitle = "公司简介"
		case "/Equipment.asp"
			strWebSiteActuallyTitle = "厂房设备"
		case "/Honors.asp"
			strWebSiteActuallyTitle = "公司荣誉"
		case "/News.asp"
			strWebSiteActuallyTitle = "新闻中心"
		case "/Product.asp"
			strWebSiteActuallyTitle = "产品中心"
		case "/Contact.asp"
			strWebSiteActuallyTitle = "联系我们"
		end select 
	else
		select case request.ServerVariables("PATH_INFO")
		case "/index.asp",""
			strWebSiteActuallyTitle = "Home"
		case "/page.asp"	
			select case  request.ServerVariables("QUERY_STRING")
			case "type=about"
				'strWebSiteActuallyTitle = "About"
			case "type=contact"
				'strWebSiteActuallyTitle = "Contact"
			end select 
		case "/Company.asp"
			strWebSiteActuallyTitle = "Company"
		case "/Equipment.asp"
			strWebSiteActuallyTitle = "Equipment"
		case "/Honors.asp"
			strWebSiteActuallyTitle = "Honors"
		case "/News.asp"
			strWebSiteActuallyTitle = "News"
		case "/Product.asp"
			strWebSiteActuallyTitle = "Product"
		case "/Contact.asp"
			strWebSiteActuallyTitle = "Contact"

		end select 
	end if
	GetWebSiteActuallyTitle =  strWebSiteActuallyTitle & " - "
end function



  Function   ClearHtml(Content)   
  Content=Zxj_ReplaceHtml("&#[^>]*;",   "",   Content)   
  Content=Zxj_ReplaceHtml("</?marquee[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("</?object[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("</?param[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("</?embed[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("</?table[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("&nbsp;","",Content)   
  Content=Zxj_ReplaceHtml("</?tr[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("</?th[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?p[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?a[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?img[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?tbody[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?li[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?span[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?div[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?th[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("</?td[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("</?script[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("(javascript|jscript|vbscript|vbs):",   "",   Content)   
  Content=Zxj_ReplaceHtml("on(mouse|exit|error|click|key)",   "",   Content)   
  Content=Zxj_ReplaceHtml("<\\?xml[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("<\/?[a-z]+:[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("</?font[^>]*>",   "",   Content)   
  Content=Zxj_ReplaceHtml("</?b[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?u[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?i[^>]*>","",Content)   
  Content=Zxj_ReplaceHtml("</?strong[^>]*>","",Content)   
  ClearHtml=Content   
  End   Function   
  
  Function   Zxj_ReplaceHtml(patrn,   strng,content)   
  IF   IsNull(content)   Then   
  content=""   
  End   IF   
  Set   regEx   =   New   RegExp '   建立正则表达式。   
  regEx.Pattern   =   patrn '   设置模式。   
  regEx.IgnoreCase   =   true             '   设置忽略字符大小写。   
  regEx.Global   =   True '   设置全局可用性。   
  Zxj_ReplaceHtml=regEx.Replace(content,strng) '   执行正则匹配   
  End   Function   





function nohtml(str) 
	dim re 
	set re=new regexp 
	re.ignorecase =true 
	re.global=true 
	re.pattern="<(.[^>]*)>" 
	str=re.replace(str,"") 
	nohtml=str 
	set re=nothing 
end function






%>



